package com.dotflat.fin.PO;

import com.dotflat.rest.PO.AreableObjectBasePO;
import com.dotflat.rest.utils.LikeableField;
import com.dotflat.rest.utils.QueryInField;
import com.dotflat.rest.utils.RangeField;
import com.dotflat.rest.utils.ReadonlyField;
import com.matt.foundation.vo.ContractVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Transient;
import java.util.Date;
import java.util.List;

/**待支付订单信息*/

@ApiModel("待支付订单信息")
@Data
@EqualsAndHashCode(callSuper = true)
public class FinPlanOrderPO extends AreableObjectBasePO {
    
    @ApiModelProperty("收款账号id")
    private String payAccountIds;

    @ApiModelProperty("作废")
    @ReadonlyField
    private Boolean cancelled;

    @ApiModelProperty("是否已经推送家长")
    @ReadonlyField
    private Boolean notified;

    @ApiModelProperty("创建时间查询左值，大于等于这个值")
    @ReadonlyField
    @RangeField(value = "created")
    private Date createdL;

    @ApiModelProperty("创建时间查询右值，小于这个值")
    @ReadonlyField
    @RangeField(value = "created", operator = '<', eq = false)
    private Date createdR;

    @ApiModelProperty("创建者名字，仅查询")
    @ReadonlyField
    @LikeableField
    private String createdByName;

    @ApiModelProperty("计划名称")
    private String planName;

    @ApiModelProperty("计划Id")
    private String planId;

    @ApiModelProperty("付款合同，若没有填写合同id，则需要 客户id + 产品ids + totalAmount")
    private String contractId;

    @ApiModelProperty("客户id")
    private String clienteleId;

    @ApiModelProperty(value = "客户id", hidden = true)
    @QueryInField("clienteleId")
    private List<String> clienteleIds;

    @ApiModelProperty("需要购买的产品列表")
    private String products;

    @LikeableField
    @ApiModelProperty("账单标题")
    private String title;

    @LikeableField
    @ApiModelProperty("学期, 仅作查询")
    private String term;

    @LikeableField
    @ApiModelProperty("备注")
    private String remark;

    @ApiModelProperty("脚注")
    private String footnote;

    @ApiModelProperty("最后更新时间")
    private Date modifyTime;

    @ReadonlyField
    @ApiModelProperty("支付状态0:未付款; 1:已付款, 2:支付中")
    private Integer payStatus;

    @ReadonlyField
    @ApiModelProperty("实付类型:alipay,wechat")
    private String payType;

    @ReadonlyField
    @ApiModelProperty("支付成功时间")
    private Date paiedTime;

    @ApiModelProperty("支付成功时间查询左值，大于等于这个值")
    @ReadonlyField
    @RangeField(value = "paiedTime")
    private Date paiedTimeL;

    @ApiModelProperty("支付成功时间查询右值，小于这个值")
    @ReadonlyField
    @RangeField(value = "paiedTime", operator = '<', eq = false)
    private Date paiedTimeR;

    @ApiModelProperty("总金额")
    private Double totalAmount;

    @ApiModelProperty("班级ID")
    private String classId;

    @LikeableField
    @ApiModelProperty("宝宝名称")
    private String childName;

    @Transient
    private ContractVo contract;

    @ApiModelProperty("班级名称")
    @Transient
    private String className;

    @ApiModelProperty("订单号（账单号）")
    private String orderSn;

    @ApiModelProperty("创建日期")
    private Date created;

}
